@charset "UTF-8";

@mixin radiusFix($dire) {
	border-top-#{$dire}-radius: 0;
	border-bottom-#{$dire}-radius: 0;
}

.#{$ns-comp}input-group {
	display: table;
	border-collapse: separate;  // 防止边框线溢出

	> .#{$ns-obj}input-addon,
	> .#{$ns-comp}button-group,
	> .#{$ns-obj}input {
		display: table-cell;
		vertical-align: middle;
	}

	/* 按钮组 */
	> .#{$ns-comp}button-group:first-child {
		> .#{$ns-obj}button {
			@include radiusFix(right);
		}

		+ .#{$ns-obj}input {
			@include radiusFix(left);
		}
	}
	> .#{$ns-comp}button-group:last-child {
		> .#{$ns-obj}button {
			@include radiusFix(left);
		}
	}

	/* 输入框 */
	> .#{$ns-obj}input {
		width: 100%;

		&:first-child {
			@include radiusFix(right);
		}

		&:not(:first-child):not(:last-child) {
			border-radius: 0;
		}

		/* 右侧是插件组或按钮组 */
		+ .#{$ns-obj}input-addon {
			@include radiusFix(left);
			border-left: 0;
		}
		+ .#{$ns-obj}button-group {
			> .#{$ns-obj}button {
				@include radiusFix(left);
			}
		}
	}
}

.#{$ns-obj}input-addon {
	padding: 0 $input-pd-lr;
	line-height: 1;
	text-align: center;
	white-space: nowrap;

	color: $normal-black;
	background-color: $color-thead;
	border: 1px solid $gray;
	border-radius: 4px;

	> [class^="icon-"] {font-size: 16px;}

	&:first-child {
		@include radiusFix(right);
		border-right: 0;

		+ .#{$ns-obj}input {
			@include radiusFix(left);
		}
	}
}
